﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Assets.Game.scripts.ui.models {
    public class PartyItemRendererModel : MonoBehaviour {

        public PartyController party;

        public int characterCount {
            get {
                return party.PeopleInParty.Count;
            }
        }

        public int averageHappyness {
            get {
                int retval = 0;
                if (this.party.PeopleInParty.Count > 0) {
                    int sum = 0;
                    foreach (SteveBrain agent in this.party.PeopleInParty) {
                        sum += agent.model.Happiness;
                    }
                    retval = sum / this.party.PeopleInParty.Count;
                }

                return retval;
            }
        }

        public string averageHappynessString {
            get {
                return this.averageHappyness.ToString() + "%";
            }
        }

    }
}
